﻿using Architecture.Domain.Service;
using MediatR;
using Microsoft.OpenApi.Any;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Goods;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Goods
{
    public class GoodsDeleteCommandHandler : IRequestHandler<GoodsDeleteCommand, int>
    {
        protected readonly IGoodService goodService;

        public GoodsDeleteCommandHandler(IGoodService goodService)
        {
            this.goodService = goodService;
        }

        public async Task<int> Handle(GoodsDeleteCommand request, CancellationToken cancellationToken)
        {
            return await goodService.GoodsInfoDel(request.ids);
        }
    }
}
